#!/usr/bin/python
#-*-coding: utf-8 -*-

"""This module contains the Exception Classes used by Deemon.

The error classes can be improved, adding more information about the errors.

"""

class Erro(Exception):
    """Error base class."""
    
    pass

class ErroCompilacao(Erro):
    """Error in the compilation of source code."""
    
    pass        

class ErroJob(Erro):
    """Error in a job."""
    
    def __init__(self,kind):
        """The Exception constructor.
        
        kind -- A string with the kind of error has occurred.
        
        """
        
        self.TipoErro = kind
        
class ErroServidor(Erro):
    """Server Connection Error."""
    
    pass

class ErroOS(Erro):
    """Operating System Error."""
    
    def __init__(self,Sistema):
        """The exception constructor.
        
        Sistema -- A string with the operating system where the Deemon is running.
        
        """ 
        
        self.RunningAt = Sistema
        
class ErroComando(Erro):
    """Command Line Error."""
    
    def __init__(self,RetCode):
        """The exception constructor.
        
        RetCode -- The return code of the command.
        
        """
        
        self.ReturnCode = RetCode
        
class ErroSQL(Erro):
    """Error in the SQL connection."""
    
    def __init__(self,kind):
        """The exception constructor.
        
        kind -- A string with the kind of error has occurred.
        
        """
        
        self.TipoErro = kind